#include "TextureManagerTest.hpp"
#include "../src/TextureManager.hpp"

TextureManagerTest::TextureManagerTest()
{
}
TextureManagerTest::~TextureManagerTest()
{
}
        
std::string TextureManagerTest::name()
{
    return "TextureManager test";
}

bool TextureManagerTest::test()
{
    TexturePtr out;
    // test if it loads a correct image
    try
    {
        out = TextureManager::instance().resource("box.png");
    }
    catch(...)
    {
        return false;
    }
    out->copyToImage().saveToFile("box.png");

        
    // test if the fail works
    try
    {
        TextureManager::instance().resource("stuff.png");
    }
    catch(...)
    {
        return true;    
    }
    return false;
}

    

